<div class="title-bar">
    <div class="actions">
        <button class="btn blue" [routerLink]="['../users/create']">添加用户</button>
    </div>
</div>

<div class="main">

    <table class="table hover">

        <thead>
            <tr>
                <th>姓名</th>
                <th>Email</th>
                <th>创建时间</th>
                <th>切换身份</th>
                <th>状态</th>
                <th>操作</th>
            </tr>
        </thead>

        <tbody>
            <tr *ngFor="let user of users">
                <td>
                    {{user.userName || '-'}}
                    <div class="mt10px">
                        <a [attr.href]="G.ENV_CONST.URI_YOUCE + '/start.html?accessToken=' + user.simulatorToken"
                           target="_blank" class="btn white" *ngIf="user.status">
                            模拟登陆
                        </a>
                    </div>
                </td>
                <td>{{user.email}}</td>
                <td>{{user.createTime | date: 'yyyy-MM-dd HH:mm'}}</td>
                <td>
                    <select #elm$root (change)="changeUserRoot(user, elm$root.value)" [(ngModel)]="user.root">
                        <option *ngFor="let root of roots" [value]="root.val">{{root.title}}</option>
                    </select>
                </td>
                <td>
                    {{user.authorise | name: 'USER_AUTHORISE'}}
                </td>
                <td>

                    <button class="btn {{user.status ? 'white' : 'blue_outer' }}" (click)="activeness(user)">
                        {{user.status ? '禁用' : '恢复' }}
                    </button>
                </td>
            </tr>
        </tbody>

    </table>

</div>